package com.yanqu.road.dataHelper.action;

import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

public class actionBase {
    public boolean isResult(List<Future> futureList){
        if(futureList.size() == 0){
            return true;
        }
        boolean result = false;
        for(Future future : futureList){
            try {
                result = (boolean) future.get();
            } catch (InterruptedException e) {
                e.printStackTrace();
            } catch (ExecutionException e) {
                e.printStackTrace();
            }
            if(!result){
                System.err.println("失败");
                return false;
            }
        }
        return true;
    }
}
